<div class="modal" ng-controller="EditModelPopupCtrl">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h2>{{'PROCESS.POPUP.EDIT-TITLE' | translate}}</h2>
      </div>
      <div class="modal-body">
        <p>{{'PROCESS.POPUP.EDIT-DESCRIPTION' | translate}}</p>
        <div class="alert error" ng-if="popup.errorMessage && popup.errorMessage.length > 0"
             style="font-size: 14px; margin-top:20px">
          <div class="popup-error" style="font-size: 14px">
            <span class="glyphicon glyphicon-remove-circle"></span>
            <span>{{popup.errorMessage}}</span>
          </div>
        </div>
        <div class="form-group">
          <label for="editProcessName">{{'PROCESS.NAME' | translate}}</label>
          <input autofocus class="form-control" editor-input-check
                 id="editProcessName" ng-disabled="popup.loading" ng-model="popup.modelName" type="text">
        </div>
        <div class="form-group">
          <label for="editProcessKey">{{'PROCESS.KEY' | translate}}</label>
          <input class="form-control" editor-input-check id="editProcessKey"
                 ng-disabled="popup.loading" ng-model="popup.modelKey" type="text">
        </div>
        <div class="form-group">
          <label for="editPocessDescription">{{'PROCESS.DESCRIPTION' | translate}}</label>
          <textarea class="form-control" id="editProcessDescription" ng-disabled="popup.loading"
                    ng-model="popup.modelDescription"
                    rows="5"></textarea>
        </div>
      </div>

      <div class="modal-footer">
        <div class="pull-right">
          <button auto-focus class="btn btn-sm btn-default" ng-click="cancel()" ng-disabled="popup.loading"
                  type="button">
            {{'GENERAL.ACTION.CANCEL' | translate}}
          </button>
          <button class="btn btn-sm btn-default" ng-click="ok()"
                  ng-disabled="popup.loading || !popup.modelName || popup.modelName.length == 0 || !popup.modelKey || popup.modelKey.length == 0"
                  type="button">
            {{'PROCESS.ACTION.EDIT-CONFIRM' | translate}}
          </button>
        </div>
        <div class="loading pull-right" ng-show="popup.loading">
          <div class="l1"></div>
          <div class="l2"></div>
          <div class="l2"></div>
        </div>
      </div>
    </div>
  </div>
</div>
